package org.huhuiyu.easyui.dao.impl;

import java.util.List;
import org.huhuiyu.easyui.enity.EmployeeModel;
import org.huhuiyu.easyui.dao.EmployeeDAO;
import org.springframework.stereotype.Service;

@Service
public class EmployeeDAOImpl extends BasicDAO implements EmployeeDAO {

	public EmployeeDAOImpl() {
	}

	@Override
	public void deleteEmployeeModel(EmployeeModel employeeModel)
			throws Exception {
		super.deleteEntity(employeeModel);
	}

	@Override
	public List<EmployeeModel> queryAllEmployeeModel() throws Exception {
		return super.queryAllEntity(EmployeeModel.class);
	}

	@Override
	public EmployeeModel queryEmployeeModelByKey(EmployeeModel employeeModel)
			throws Exception {
		return super.queryEntityByKey(employeeModel.getEmpId(),
				EmployeeModel.class);
	}

	@Override
	public void saveEmployeeModel(EmployeeModel employeeModel) throws Exception {
		super.saveEntity(employeeModel);
	}

	@Override
	public void updateEmployeeModel(EmployeeModel employeeModel)
			throws Exception {
		super.updateEntity(employeeModel);
	}

	@Override
	public int queryEmployeeModelCount()
			throws Exception {
		return super.queryHqlCount("select count(empId) from EmployeeModel");
	}

	@Override
	public List<EmployeeModel> queryPageEmployeeModel(int start, int limit) throws Exception {
		return super.queryHqlEntityListByPage(EmployeeModel.class,
				"from EmployeeModel", start, limit);
	}
}